package test2;




import java.util.*;

public class Main {
    public static void main(String[] args) {
        Integer[] nums = {-4,-1,0,3,10};
        TreeSet<Integer> treeSet = new TreeSet<>();
        for (int i = 0; i < nums.length; i++) {
              treeSet.add(nums[i]*nums[i]);
        }
        Integer[] objects = (Integer[]) treeSet.toArray();
        System.out.println(treeSet);
    }
}